<?php

defined('_JEXEC') or die('Restricted access');

class TableShop extends JTable
{
    public $id=0;
    public $userId=0;
    public $name='';
    public $about='';
    public $address='';
    
    public function __construct($db) {
        parent::__construct('#__shops', 'id', $db);
    }
    
    public function check() 
    {   
        return true;
    }
    
    public function store($updateNulls = false) {
        if($this->userId < 1)
        {
            $user = JFactory::getUser();
            $this->userId = $user->get('id');
        }

        if(!$this->check())
            return false;
        
        return parent::store($updateNulls);
    }
}
?>
